package com.commons.base.model;

import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.plugins.Page;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 分页实体类
 * 
 * @author xkq
 * @date 2018年8月3日
 */
@ApiModel(description = "分页实体类")
public class AdminPage<T> implements Serializable {
	private static final long serialVersionUID = 1L;

	public AdminPage() {
	}

	public AdminPage(Page<T> t) {
		this.total = t.getTotal();
		this.size = t.getSize();
		this.pages = t.getPages();
		this.current = t.getCurrent();
		this.records = t.getRecords();
	};

	@ApiModelProperty(value = "数据列表")
	private List<T> records;
	/* 总数 */
	@ApiModelProperty(value = "总数")
	private int total;

	/* 每页显示条数，默认 10 */
	@ApiModelProperty(value = "每页显示条数")
	private int size = 10;

	/* 总页数 */
	@ApiModelProperty(value = "总页数")
	private int pages;

	/* 当前页 */
	@ApiModelProperty(value = "当前页")
	private int current = 1;

	/**
	 * records
	 *
	 * @return the records
	 */

	public List<T> getRecords() {
		return records;
	}

	/**
	 * @param records the records to set
	 */

	public void setRecords(List<T> records) {
		this.records = records;
	}

	/**
	 * total
	 *
	 * @return the total
	 */

	public int getTotal() {
		return total;
	}

	/**
	 * @param total the total to set
	 */

	public void setTotal(int total) {
		this.total = total;
	}

	/**
	 * size
	 *
	 * @return the size
	 */

	public int getSize() {
		return size;
	}

	/**
	 * @param size the size to set
	 */

	public void setSize(int size) {
		this.size = size;
	}

	/**
	 * pages
	 *
	 * @return the pages
	 */

	public int getPages() {
		return pages;
	}

	/**
	 * @param pages the pages to set
	 */

	public void setPages(int pages) {
		this.pages = pages;
	}

	/**
	 * current
	 *
	 * @return the current
	 */

	public int getCurrent() {
		return current;
	}

	/**
	 * @param current the current to set
	 */

	public void setCurrent(int current) {
		this.current = current;
	}
}
